﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Universe.MediaProbe.Tests
{
    using System.Diagnostics;

    using Utils;

    class MyEnv
    {
        public static void Setup()
        {
            if (!Trace.Listeners.OfType<DefaultTraceListener>().Any())
            {
                Trace.Listeners.Add(new DefaultTraceListener());
            }

            if (Environment.OSVersion.Platform == PlatformID.Unix)
            {
                string consoleArm = "Console@Arm";
                if (!Trace.Listeners.OfType<TextWriterTraceListener>().Any(x => x.Name == consoleArm))
                {
                    TextWriterTraceListener tl = new TextWriterTraceListener(Console.Out, consoleArm);
                    Trace.Listeners.Add(tl);
                }
            }

            Trace.WriteLine("Platform: " + CrossInfo.ThePlatform);
            Trace.WriteLine("Is Linux on Arm: " + CrossInfo.IsLinuxOnArm);
            Trace.WriteLine("Runtime: " + CrossInfo.RuntimeDisplayName);
            Trace.WriteLine("OS: " + CrossInfo.OsDisplayName);
        }
    }
}
